<?php
include 'mysql.php';
if(isset($_GET['action'])&&$_GET['action'])
{
    if($_GET['action']=='delete')
    {
        if(isset($_GET['id'])&&$_GET['id'])
        {
            $id = $_GET['id'];
            $query = "DELETE FROM `activity` WHERE  id = '".$id."' ";
            $result=$mysqli->query($query);
            if($result)
            {
                header("Location:/activity.php");
            }


        }
    }
    else
    {
         header("Location:/activity.php");
    }


    if($_GET['action']=='delete_pic')
    {
        if(isset($_GET['id'])&&$_GET['id'])
        {
            $id = $_GET['id'];
            $query = "DELETE FROM `photo` WHERE  id = '".$id."' ";
            $result=$mysqli->query($query);
            if($result)
            {
                header("Location:/focus.php");
            }


        }
    }
    else
    {
        header("Location:/focus.php");
    }

}

$mysqli->close();
